<template>
	<sw-common-frame :count="dataCount" :loading="loading">
		<template slot="button">
			<el-button size="small" type="primary" icon="el-icon-plus" @click="handleOpenDialog()">新增</el-button>
		</template>
		<el-form slot="query" size="small" inline>
			<el-form-item>
				<el-input v-model="queryData.name" clearable placeholder="请输入名称" style="width: 180px"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" icon="el-icon-search" @click="handleQueryTableData()">查询</el-button>
			</el-form-item>
		</el-form>
		<el-table slot="table" :data="tableData" height="100%" stripe>
			<el-table-column label="排序" width="50" align="center" prop="orderBy"></el-table-column>
			<el-table-column label="链接名称" prop="linkName" min-width="320"></el-table-column>
			<el-table-column label="链接地址" prop="linkHref" min-width="320"></el-table-column>
			<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
			<el-table-column label="操作" width="132">
				<el-button-group slot-scope="{ row }">
					<el-button size="mini" type="warning" @click="handleOpenDialog(row.id)">编辑</el-button>
					<el-button size="mini" type="danger" @click="handleDeleteData(row)">删除</el-button>
				</el-button-group>
			</el-table-column>
		</el-table>
		<sw-pagination slot="page" :total="dataCount" :page.sync="queryData.page" :limit.sync="queryData.limit" @change="queryTableData()" />
		<form-dialog v-model="formDialog" :data-id="dataId" @refresh="queryTableData()"></form-dialog>
	</sw-common-frame>
</template>

<script>
import formDialog from './form';
import listMixins from '@/mixins/listMixins';
import { queryAddressList, deleteAddress } from '@/api/basedata/tbSysAddress';
export default {
	mixins: [listMixins],
	components: { formDialog },
	data() {
		return {
			pageName: '友情链接'
		};
	},
	computed: {
		listFunction() {
			return eval(queryAddressList);
		},
		deleteFunction() {
			return eval(deleteAddress);
		}
	}
};
</script>

<style lang="scss" scoped></style>
